package com.ghsc.ghxc.jsb.ui.home.view

import android.widget.ImageView
import android.widget.TextView
import androidx.fragment.app.FragmentActivity
import androidx.recyclerview.widget.RecyclerView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.cn.appcore.ext.setSingleClickListener
import com.ghsc.ghxc.jsb.R
import com.lxj.xpopup.core.CenterPopupView

//看光广告的弹窗
class AdvCompletePopView(context: FragmentActivity, msg:String,pstatus:Int,tvBtn:()->Unit) : CenterPopupView(context) {


    private var tvBtn: () -> Unit = tvBtn

    val msg = msg
    val pstatus=pstatus
    override fun getImplLayoutId() = R.layout.popup_adv_complete
    override fun onCreate() {
        super.onCreate()
        val tvmsg = findViewById<TextView>(R.id.msg)
        val tvPstatus = findViewById<TextView>(R.id.tvPstatus)
        tvmsg.text=msg

        if(pstatus==0) tvPstatus.text="继续观看"
        else  if(pstatus==1) tvPstatus.text="立即领取"
        else tvPstatus.text="已完成"

        tvPstatus.setSingleClickListener {
            tvBtn.invoke()
            dismiss()
        }
    }
}